package org.example.custom.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

@Data
@ConfigurationProperties(prefix = "spring.datasource.dynamic")  //读取yml中配置
public class DynamicDataSourceProperties {
    /**
     * 默认数据源 key
     */
    private String primary;

    /**
     * 多数据源配置 key → 配置对象
     */
    private Map<String, DataSourceProperty> datasource = new HashMap<>();
}

